﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;

namespace DemoUserInfo.Models
{
    public class VideoNums
    {
        private int _cnt = 0;
        public static VideoNums Create()
        {
            return new VideoNums();
        }

        public int Cnt
        {
            get
            {
                _cnt++;
                return _cnt;
            }
        }
    }
    public class Video
    {
        public int Id { get; set; }
        public string Title { get; set; }
        public DateTime Date { get; set; }
        public string Source { get; set; }
        public string TitleImgSrc { get; set; }
        public string Tag { get; set; }
        [StringLength(55)]
        public string Introduction { get; set; }
    }
    public class VideoDbContext : DbContext
    {
        public VideoDbContext()
            : base("VideoDbContext")
        {
        }
        public static VideoDbContext Create()
        {
            return new VideoDbContext();
        }
        public DbSet<Video> Videos { get; set; }
    }
}